import 'package:flutter/material.dart';

import '../widgets/center_cell.dart';

class CenterPageWidget extends StatefulWidget {
  const CenterPageWidget({super.key});

  @override
  State<StatefulWidget> createState() => CenterPageState();
}

class CenterPageState extends State<CenterPageWidget> {
  List items = [
    {"name": "消息", "number": "1"},
    {"name": "推送", "number": "12"},
    {"name": "通告", "number": "8"},
  ];

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(
        title: const Text("消息中心"),
      ),
      body: ListView.builder(
        itemBuilder: (BuildContext context, int index) {
          var temp = items[index];
          return Column(
            children: [
              CenterCell(title: temp["name"], number: temp["number"]),
              const Divider(
                height: 1,
                color: Color(0xffe5e5e5),
              ),
            ],
          );
        },
        itemCount: items.length,
      ),
    );
  }
}
